/**
 * Wihidum - Efficient Broker Hierarchy for Publish Subscribe Middleware
 *
 * License      :   Apache License 2.0
 * Home Page    :   http://code.google.com/p/wihidum/
 * Mailing List :   wihidum@googlegroups.com
 */

package lk.mrt.cse.wihidum.storage;

import java.util.*;

/**
 * Interface to access subscribers in database
 */
public interface SubscriberManager
{

    /**
     * Save a subscriber
     *
     * @param subscriber Subscriber to be saved
     * @return True if saved successfully, Otherwise false
     */
    public boolean saveSubscriber (Subscriber subscriber);

    /**
     * Get subscribers registered to the given topic
     *
     * @param topic Topic to be considered
     * @return List of subscribers registered to the given topic
     */
    public ArrayList<Subscriber> getSubscribersFilteredByTopic (String topic);

    /**
     * Check whether given subscription is already existing in the database
     *
     * @param subscriptionID The new subscription id
     * @return True if duplicated subscription, otherwise false
     */
    public boolean isDuplicatedSubscriber (String subscriptionID);
}
